const Router = require('@koa/router');//导入koa-router模块

const jindianRouter = new Router({ //实例化用户相关的子路由对象
  prefix: '/jindian' // 设置路由前缀
});

//http://localhost:3000/jindian/
jindianRouter.get('/', (ctx, next) => {
  ctx.body = {
    message: 'User home page'
  };
});
//http://localhost:3000/jindian/add
jindianRouter.post('/add', (ctx, next) => {
  ctx.body = {
    message: 'Add jindian'
  };
});

module.exports = jindianRouter;